package com.megvii.corelib.util;

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

/**
 * Created by linyue on 16/3/1.
 */
public class IMEUtil
{
    public static void HideIME(Context context, View windowAcceptingInput)
    {
        InputMethodManager imm = (InputMethodManager) context
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(windowAcceptingInput.getWindowToken(), 0);
    }

    public static void ShowIME(Context context, View windowAcceptingInput)
    {
        InputMethodManager imm = (InputMethodManager) context
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.showSoftInput(windowAcceptingInput, InputMethodManager.SHOW_IMPLICIT);
    }
}
